<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>从资源流里移除某个过滤器</title>
 </head>
 <body class="docs"><div id="layout">
  <div id="layout-content"><div id="function.stream-filter-remove" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">stream_filter_remove</h1>
  <p class="verinfo">(PHP 5 &gt;= 5.1.0, PHP 7)</p><p class="refpurpose"><span class="refname">stream_filter_remove</span> &mdash; <span class="dc-title">从资源流里移除某个过滤器</span></p>

 </div>
 <div class="refsect1 description" id="refsect1-function.stream-filter-remove-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>stream_filter_remove</strong></span>
    ( <span class="methodparam"><span class="type">resource</span> <code class="parameter">$stream_filter</code></span>
   ) : <span class="type">bool</span></div>

  <p class="para rdfs-comment">
   移除之前通过 <span class="function"><a href="stream_filter_prepend.html" class="function">stream_filter_prepend()</a></span> 或者 <span class="function"><a href="stream_filter_append.html" class="function">stream_filter_append()</a></span> 添加到资源流里面的过滤器。
   在移除之前，残留在过滤器内部缓冲区里的所有数据刷新到下一个过滤器。
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.stream-filter-remove-parameters">
  <h3 class="title">参数</h3>
  <p class="para">
   <dl>

    
     <dt>
<code class="parameter">stream_filter</code></dt>

     <dd>

      <p class="para">
       需要被移除的资源流过滤器。
      </p>
     </dd>

    
   </dl>

  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.stream-filter-remove-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   成功时返回 <strong><code>TRUE</code></strong>， 或者在失败时返回 <strong><code>FALSE</code></strong>。
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-function.stream-filter-remove-examples">
  <h3 class="title">范例</h3>
  <p class="para">
   <div class="example" id="example-4822">
    <p><strong>Example #1 动态地重新过滤一个资源流</strong></p>
    <div class="example-contents">
<div class="phpcode"><pre><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br /></span><span style="color: #FF8000">/*&nbsp;Open&nbsp;a&nbsp;test&nbsp;file&nbsp;for&nbsp;reading&nbsp;and&nbsp;writing&nbsp;*/<br /></span><span style="color: #0000BB">$fp&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">fopen</span><span style="color: #007700">(</span><span style="color: #DD0000">"test.txt"</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"rw"</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">$rot13_filter&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">stream_filter_append</span><span style="color: #007700">(</span><span style="color: #0000BB">$fp</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"string.rot13"</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">STREAM_FILTER_WRITE</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">fwrite</span><span style="color: #007700">(</span><span style="color: #0000BB">$fp</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"This&nbsp;is&nbsp;"</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">stream_filter_remove</span><span style="color: #007700">(</span><span style="color: #0000BB">$rot13_filter</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">fwrite</span><span style="color: #007700">(</span><span style="color: #0000BB">$fp</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"a&nbsp;test\n"</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">rewind</span><span style="color: #007700">(</span><span style="color: #0000BB">$fp</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">fpassthru</span><span style="color: #007700">(</span><span style="color: #0000BB">$fp</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">fclose</span><span style="color: #007700">(</span><span style="color: #0000BB">$fp</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</pre></div>
    </div>

    <div class="example-contents"><p>以上例程会输出：</p></div>
    <div class="example-contents screen">
<div class="cdata"><pre>
Guvf vf a test
</pre></div>
    </div>
   </div>
   
  </p>
 </div>


 <div class="refsect1 seealso" id="refsect1-function.stream-filter-remove-seealso">
  <h3 class="title">参见</h3>
  <p class="para">
   <ul class="simplelist">
    <li class="member"><span class="function"><a href="stream_filter_register.html" class="function" rel="rdfs-seeAlso">stream_filter_register()</a> - Register a user defined stream filter</span></li>
    <li class="member"><span class="function"><a href="stream_filter_append.html" class="function" rel="rdfs-seeAlso">stream_filter_append()</a> - Attach a filter to a stream</span></li>
    <li class="member"><span class="function"><a href="stream_filter_prepend.html" class="function" rel="rdfs-seeAlso">stream_filter_prepend()</a> - Attach a filter to a stream</span></li>
   </ul>
  </p>
 </div>

</div></div></div></body></html>